package com.appointmentmanager.web;
 
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
 
@Controller
public class LoginController {
 
//	private Logger logger = LoggerFactory.getLogger(getClass());
	
	/*@RequestMapping(value="/signin", method = RequestMethod.GET)
	public String login(ModelMap model) {
 
		return "signin";
 
	}*/
	
	@RequestMapping(value="/login", method = RequestMethod.GET)
	public String login(ModelMap model) {
 
		return "login";
 
	}
	
	@RequestMapping(value="/signin", method = RequestMethod.POST)
	public String signin(ModelMap model) {
 
		return "signin";
 
	}
	/*@RequestMapping(value="/login", method = RequestMethod.GET)
	public String loginIgnore(ModelMap model) {
 
		return "login";
 
	}*/
	
	@RequestMapping(value="/loginfailed", method = RequestMethod.GET)
	public String loginerror(ModelMap model) {
//		logger.debug("login failed");
		
		model.addAttribute("error", "true");
		return "signin";
 
	}
	
	@RequestMapping(value="/logout", method = RequestMethod.GET)
	public String logout(ModelMap model) {
 
		return "signin";
 
	}
	
}